package com.yt.sys.service;

import com.yt.sys.models.vo.ProfessionInfoVO;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.yt.sys.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yt.sys.mapper.ProfessionInfoMapper;
import com.yt.sys.models.service.IProfessionInfoService;
import com.yt.sys.models.bo.ProfessionInfoSaveBO;
import com.yt.sys.models.dto.ProfessionInfoDTO;

import java.util.List;

/**
 * 专业详情控制器
 *
 * @author thekai
 * @Date 2025-10-29 09:53:16
 */
@DubboService
public class ProfessionInfoServiceImpl extends ServiceImpl<ProfessionInfoMapper, ProfessionInfoDTO> implements IProfessionInfoService{

    @Resource
    private YmlConfig ymlConfig;
    @Resource
    private ProfessionInfoMapper professionInfoMapper;

    @Override
    public boolean add(ProfessionInfoSaveBO saveBO) {
        ProfessionInfoDTO dto = new ProfessionInfoDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
    @Override
     public List<ProfessionInfoVO> query() {
        List<ProfessionInfoVO> professionInfoVOS=professionInfoMapper.query();
        return professionInfoVOS;
    }
}
